package com.joelaws.blackberry;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.LabelField;

public class ViewScreen extends BaseScreen {
	public ViewScreen(final String thisUser, final String otherUser,
			Bitmap image, String[] data) {
		ButtonField meet = new ButtonField("Meet");
		meet.setChangeListener(new FieldChangeListener() {
			public void fieldChanged(Field field, int context) {
				new Thread() {
					public void run() {
						pushScreen(new MeetScreen(thisUser, otherUser));
					}
				}.start();
			}
		});

		add(meet);

		add(new BitmapField(image));

		for (int i = 0; i < data.length; i++) {
			add(new LabelField(data[i]));
		}
		ButtonField meet2 = new ButtonField("Meet");
		meet2.setChangeListener(new FieldChangeListener() {
			public void fieldChanged(Field field, int context) {
				new Thread() {
					public void run() {
						pushScreen(new MeetScreen(thisUser, otherUser));
					}
				}.start();
			}
		});
		add(meet2);
	}
}